package com.anjubao.parking.municipal.user.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 车牌解绑 / 绑定
 *
 * @author zhuchunfeng
 * @date 2019/7/3 13:27
 */
@Getter
@AllArgsConstructor
public enum VehicleOperateEnum {

    BIND(1, "绑定"),
    UNBIND(2, "解绑");

    private Integer code;

    private String desc;

    public static VehicleOperateEnum getByCode(Integer code) {
        for (VehicleOperateEnum e : VehicleOperateEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }

    public static Boolean exist(Integer code) {
        for (VehicleOperateEnum e : VehicleOperateEnum.values()) {
            if (e.getCode().equals(code)) {
                return true;
            }
        }
        return false;
    }
}
